package Schedule::Cron::Finance::Money::Inflated;

use warnings;
use strict;

use base qw(Schedule::Cron::Finance::Money Class::Accessor::Class);

# Inflation is a class method, as it equally affects all inflated money values
# across the plan.

__PACKAGE__->mk_class_accessors(qw(compound_inflation));


sub init {
    my $self = shift;
    $self->SUPER::init(@_);
    $self->compound_inflation(1) unless defined $self->compound_inflation;
}


sub inflate_by {
    my ($self, $inflation) = @_;
    $self->compound_inflation($self->compound_inflation * $inflation);
}


sub _get_amount {
    my $self = shift;
    $self->SUPER::_get_amount() * $self->compound_inflation;
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - Money object that knows about inflation

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

